package com.asnike.selector{
	import flash.display.Sprite;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	import flash.text.TextFormat;
	
	public class CampItemBar extends Sprite{
		
		public var price:TextField;
		public var checkBox:Sprite;
		public var itemName:TextField;
		
		public function CampItemBar(){
			super();
			buttonMode = true;
			initText();
		}
		private function initText():void{
			var format:TextFormat;
			
			format = new TextFormat( 'ygo340', 12 );
			itemName.defaultTextFormat = format;
			itemName.embedFonts = true;
			itemName.selectable = false;
			itemName.mouseEnabled = false;
			itemName.multiline = false;
			itemName.wordWrap = false;
			itemName.autoSize = TextFieldAutoSize.LEFT;
			
			format = new TextFormat( 'ygo340', 12 );
			price.defaultTextFormat = format;
			price.embedFonts = true;
			price.selectable = false;
			price.mouseEnabled = false;
			price.multiline = false;
			price.autoSize = TextFieldAutoSize.LEFT;
		}
		
		internal function setItemName( $name:String ):void{
			itemName.text = $name;
			price.x = itemName.x + itemName.width + 5;
		}
		
		internal function setPrice( $value:int ):void{
			price.text = $value.toString() + '원';
		}
		
		internal function getPrice():int{
			return int( price.text.replace( '원', '' ) );
		}
		internal function getName():String{
			return itemName.text;
		}
	}
}